package com.yxq.mdt.app.modules.socialcontact.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.bean.UploadImageBean;

import java.util.List;

/**
 * @author L
 * @time 2019-11-07
 * @describe 图片上传选择器$
 */
public class PublishImageListAdapter extends BaseMultiItemQuickAdapter<UploadImageBean, BaseViewHolder> {


    public PublishImageListAdapter(List<UploadImageBean> data) {
        super(data);
        addItemType(-1, R.layout.layout_item_selector_image);
        addItemType(0, R.layout.layout_item_selector_img_publish);
    }

    @Override
    protected void convert(BaseViewHolder helper, UploadImageBean item) {
        switch (item.getItemType()) {
            case -1:
                break;
            case 0:
                GlideHelper.setLoadVideoImage(mContext, item.getPath(), R.color.gray, helper.getView(R.id.iv_img));
                helper.addOnClickListener(R.id.iv_delete);
                break;
        }

    }
}
